[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
STUFF()

    STUFF() deletes, inserts, and/or replaces characters in a character
    string.

Syntax

    STUFF(<expC1>,<expN1>,<expN2>,<expC2>0

Arguments

    <expC1> is the target character string.

    <expN1> is the starting position in the target string where the
    replacement occurs.

    <expN2> is the number of characters to replace in the target string
    (<expC1>).

    <expC2> is the replacement string.

Returns

    A character string.

    Essentially STUFF() replaces <expN2> characters in the target string
    (<expC1> beginning at <expN1> with <expC2>.

Usage

    With this basic structure STUFF() can perform the following six
    operations:

    Insert: If you specify zero for <expN2>, no characters are removed
    from <expC1>, the replacement string (<expC2>) is inserted at <expN1>,
    and the entire string is returned.

    Replace: If you specify a replacement string (<expC2>) the same length
    as <expN2>, <expC2> replaces characters beginning at <expN1>.

    Delete: If replacement string (<expC2>) is a null string (""), the
    number of characters specified by <expN2> are removed from <expC1> and
    the string is returned without any added characters.

    Replace and Insert: If the replacement string (<expC2>) is longer than
    <expN2>, all characters from <expN1> are replaced and the rest of the
    replacement string (<expC2> is inserted.

    Replace and Delete: If the length of the replacement string (<expC2>)
    is less than <expN2>, all characters in the target string (<expC1>) are
    deleted from the end of <expC2> up to <expN2>.

    Replace and Delete Rest: If <expN2> is greater than the length of the
    target string (<expC1>), the replacement string (<expC2>) is inserted
    at <expN1> and the rest of <expC1> is deleted.

See Also: AT LEFT RIGHT RAT STRTRAN SUBSTR
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson